#include <iostream>
#include <string>


class Command
{
public:
    std::string Excute(std::string cmdstr)
    {
        FILE *fp = ::popen(cmdstr.c_str(), "r");
        if (nullptr == fp)
        {
            return std::string("Failed");
        }
        char buffer[1024];
        std::string result;
        while (true)
        {
            char *ret = ::fgets(buffer, sizeof(buffer), fp);
            if (!ret)
                break;
            result += ret;
        }
        pclose(fp);
        return result.empty() ? std::string("Done") : result;
    }
private:

};